package com.bean;

import java.sql.Timestamp;
import java.util.Objects;

public class Courier {
    private Integer id;
    private String userName;

    public Courier(String userName, String userPhone, String cardNumber, String password) {
        this.userName = userName;
        this.userPhone = userPhone;
        this.cardNumber = cardNumber;
        this.password = password;
    }

    private String userPhone;
    private String cardNumber;
    private String password;
    private Integer sum;
    private Timestamp regTime;
    private Timestamp lastLoginTime;

    @Override
    public String toString() {
        return "Courier{" +
                "id=" + id +
                ", userName='" + userName + '\'' +
                ", userPhone='" + userPhone + '\'' +
                ", cardNumber='" + cardNumber + '\'' +
                ", password='" + password + '\'' +
                ", sum=" + sum +
                ", regTime=" + regTime +
                ", lastLoginTime=" + lastLoginTime +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Courier courier = (Courier) o;
        return Objects.equals(id, courier.id) && Objects.equals(userName, courier.userName) && Objects.equals(userPhone, courier.userPhone) && Objects.equals(cardNumber, courier.cardNumber) && Objects.equals(password, courier.password) && Objects.equals(sum, courier.sum) && Objects.equals(regTime, courier.regTime) && Objects.equals(lastLoginTime, courier.lastLoginTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, userName, userPhone, cardNumber, password, sum, regTime, lastLoginTime);
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getUserPhone() {
        return userPhone;
    }

    public void setUserPhone(String userPhone) {
        this.userPhone = userPhone;
    }

    public String getCardNumber() {
        return cardNumber;
    }

    public void setCardNumber(String cardNumber) {
        this.cardNumber = cardNumber;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Integer getSum() {
        return sum;
    }

    public void setSum(Integer sum) {
        this.sum = sum;
    }

    public Timestamp getRegTime() {
        return regTime;
    }

    public void setRegTime(Timestamp regTime) {
        this.regTime = regTime;
    }

    public Timestamp getLastLoginTime() {
        return lastLoginTime;
    }

    public void setLastLoginTime(Timestamp lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    public Courier() {
    }

    public Courier(Integer id, String userName, String userPhone, String cardNumber, String password, Integer sum, Timestamp regTime, Timestamp lastLoginTime) {
        this.id = id;
        this.userName = userName;
        this.userPhone = userPhone;
        this.cardNumber = cardNumber;
        this.password = password;
        this.sum = sum;
        this.regTime = regTime;
        this.lastLoginTime = lastLoginTime;
    }
}
